{% extends './base.html' %}
{% block head%}
<title>HDUDB</title>
{% endblock %}
{% block content %}
<div class="container-xxl mt-3">
    <div class="alert alert-success" role="alert">
        有疑惑？有建议？或者只是想交个朋友？欢迎来<strong>QQ群884065470</strong>找我们玩§(*￣▽￣*)§
    </div>
    <div class="row row-cols-1 row-cols-md-3 row-cols-lg-4 g-4">
        {% for lesson in lessons %}
        <div class="col">
            <div class="card h-100 shadow-sm">
                <div class="card-header">
                    {{lesson.name}}
                    <small class="text-muted">by {{ lesson.teacher }}</small>
                </div>
                <div class="card-body">
                    <div class="card-text">
                        {{ lesson.bestcomment.html|safe }}
                    </div>
                    <blockquote class="blockquote mb-0" style="padding-bottom: 1rem;">
                        <p class="blockquote-footer text-end"> {{ lesson.bestcomment.term }} <cite
                                title="Source Title">{{ lesson.bestcomment.user.name }}</cite>
                        </p>
                    </blockquote>
                </div>
                <div class="d-grid gap-2 d-md-flex justify-content-md-end m-2">
                    <a href="{% url 'lesson:lesson' lesson.id %}" class="btn btn-primary ">查看详情</a>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}